using System;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Impact.Web.Admin.Controls
{
    /// <summary>
    /// Code behind for the submit/cancel control
    /// </summary>
    public partial class SubmitCancel : UserControl
    {
        /// <summary>
        /// Event is fired when the user clicks Submit
        /// </summary>
        public event EventHandler Submit;

        /// <summary>
        /// Event is fired when the user clicks Cancel
        /// </summary>
        public event EventHandler Cancel;

        /// <summary>
        /// Event handler is fired when the user clicks Submit.  refires the public event.
        /// </summary>
        protected void OnCancel(object sender, CommandEventArgs e)
        {
            if(Cancel != null) Cancel(this, new EventArgs());
        }

        /// <summary>
        /// Event handler is fired when the user clicks Cancel.  refires the public event.
        /// </summary>
        protected void OnSubmit(object sender, CommandEventArgs e)
        {
            if (Submit != null) Submit(this, new EventArgs());
        }

    }
}